﻿using UnityEngine;
using System.Collections;

public class BorderManager : MonoBehaviour {

	public BoxCollider2D leftBox;

	public BoxCollider2D rightBox;

	void InitBorder(Vector2 size){
		var boxWidth = 0.1f;
		var boxHeight = size.y * 2f;
		leftBox.size = new Vector2( boxWidth,boxHeight );
		rightBox.size = new Vector2( boxWidth,boxHeight );
		var dx = size.x/2 + boxWidth;
		leftBox.transform.position = new Vector3( dx,leftBox.transform.position.y );
		rightBox.transform.position = new Vector3( -dx,leftBox.transform.position.y );
	}

}
